package com.dz.usersystem.config;


import java.io.FileWriter;
import java.io.IOException;


    /* *
     *类名：AlipayConfig
     *功能：基础配置类
     *详细：设置帐户有关信息及返回路径
     *修改日期：2017-04-05
     *说明：
     *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
     *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
     */
    public class AlipayConfig {
        //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

        // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
        public static String app_id = "2016102700771599";

        // 商户私钥，您的PKCS8格式RSA2私钥
        public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCrhOmSQZ5IFe6B4oQPgSFXV/GCv2ePwYwq1b0qe2SaX4VxFydVlASPOSC0q75he9u3y8MO22u/UsJwR7jLgU5ZO+oXeN4P49mO566mvCOGZdtHUBJyq82UTdeOVCpjE2VwtDxcMrBCRYyEzg7mbOLB9PUGzg4BYTK516f41PVbNq5t5lXBB4Zjwjer1c2CPRw9iNaE96GfgHFHVaY3iNXoYxVgiTdZGc6dIoPgukITkVi/orY+t5Vw4PC6VPhLK6UIP3nQRs/t2nIjNjI4P+fyNIuEyLe3hHqSoYPEPd24sECAWZiztOyNgdljBDTCWSDweXOE8x77zBghGjJp4pkjAgMBAAECggEBAIyz0e/7CF9WLnw6V99oLPO73xFE9y3EtrmE8VNiOhsxdQRa3Bel/z+Gu7+6i8jolEvoSbFsaq1etMbq7ztybdViAx0SOAiM/7HteSaqe/IKqKGNnDSZn2GjocrOXJ8+EB8um71+j30uFKH1b9+zPymhS0gzzOVw2O3/bXoBKO2TSv8/N2dmBtj8g4hjNGmgAxiG1hL2I7Wt2dkxdLIFsgKc/L+8p3vyVe0d0htLPGsukUGqOX+3cc2OfcJmZY6xraOj5DV7dtn8pDxLvOUzFijzn0jI2aMDQKDQAsHZ9GvzNvqwx5dvgbXJQyR8wL7NxSrbRUiYyeiixBpbG9Q9n0ECgYEA41rFdGMMMsEK6E+i7BskoER8sKfKuXDwmj21kuh+s53Uk3ZYJPrHREoWRclp+I5DQuFaZa6CUVU/1YifLahdNsLHWr6ALtJCy+RSPGuh9Br6LvvE3AnxXqU7xk233HvORzI99a0mUhR0nDyJjMvVXR++re16n56keBoPxFvKgTMCgYEAwSExjYUKRwCv4RVyC7YjZ3w+LmhP5JenwXFla8ZMydhuruGQ95Xr1Jm2i29tgatFNR0XllA5mfxVdvU8Rb//2Kuvy9PxEHL49YFCcjpxCv34bfExBp60TM+YcexwglQmdk0Ib6oi3l5ytPThp+rddPop/uA6w5ooqN6UT0JhaFECgYA7syUwR6X3Wdt8XxT//KykbPd1B8pi4XY8ekHInsZOcf5U7nl81GEo3G92ycnK28hrsnMjSiysIL+PWb26poA7le/1MxrDsLCbi4vQk87GI6NYXQI3aWD5IlhM3TGPcu8aoOXGMj5ixT5NnFPeJdQUDPbsAvT1Hxo+81D6lcPaIwKBgEJttmulDSnq9JQJGlco6PiZZZH00zYfa9Y/uNDfPl5XEYsZjxF6Acn4rS88vn/Rd1aTkR9krMtoXcUzCO484jWWqDsFxW8Q/M0FDuPXcjaDsMWwJlrOj9mztg3Jc9GAPFKIoJQ4AxJVjkLr0Ao/4Lhxq6w9WDkbd0zOcljozjRhAoGASHY8fTcHWtlln548wXyvu7BT0+qKiz440LyUHBQq1hNClIAa6ITi006QcUKQq6KEFXgN0QVgTKt+W9mAcfQLmuTcCFMidrqXsgc20wXsusbSKVq3NyKBBKkTkBkuYySwwm/qmJh15YWU+cJ/U3QkcBlJM14BihDnTSUBj9/1Jo8=";

        // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
        public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq4TpkkGeSBXugeKED4EhV1fxgr9nj8GMKtW9Kntkml+FcRcnVZQEjzkgtKu+YXvbt8vDDttrv1LCcEe4y4FOWTvqF3jeD+PZjueuprwjhmXbR1AScqvNlE3XjlQqYxNlcLQ8XDKwQkWMhM4O5mziwfT1Bs4OAWEyuden+NT1WzaubeZVwQeGY8I3q9XNgj0cPYjWhPehn4BxR1WmN4jV6GMVYIk3WRnOnSKD4LpCE5FYv6K2PreVcODwulT4SyulCD950EbP7dpyIzYyOD/n8jSLhMi3t4R6kqGDxD3duLBAgFmYs7TsjYHZYwQ0wlkg8HlzhPMe+8wYIRoyaeKZIwIDAQAB";

        // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
        public static String notify_url = "http://localhost:8082/";

        // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
        public static String return_url = "http://localhost:8082/";

        // 签名方式
        public static String sign_type = "RSA2";

        // 字符编码格式
        public static String charset = "utf-8";

        // 支付宝网关
        public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

        // 支付宝网关
        public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

        /**
         * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
         * @param sWord 要写入日志里的文本内容
         */
        public static void logResult(String sWord) {
            FileWriter writer = null;
            try {
                writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
                writer.write(sWord);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                if (writer != null) {
                    try {
                        writer.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }

    }



